package com.IO流.处理流.Input_Output_StreamReader_Writer__转换流;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class OutputStreamWriter__ {
    public static void main(String[] args) throws IOException {
        String filename = "D:/JAVA_test/OutputStreamWriter.txt";  ///路径
        String charSet = "GBK";  ///编码格式
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream(filename), charSet);  ///创建转换流将字节流转换成字符流，编码GBK
        osw.write("哈哈哈哈哈123456");   ///写入
        osw.close();
        System.out.println("ok~~");
    }
}
